<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>我的订单</title>
<link href="assets/bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css">
<link href="assets/app/application.css" rel="stylesheet" type="text/css">

</head>
<body>

<%@ include file="index_head.jsp"%>

<div class="container">
	<h4>我的购物车<small class="numberic_red">&nbsp;&nbsp;&nbsp;在线支付全场满¥99免运费</small></h4>
</div>

<!--   主要内容   -->
<div class="container">
            <table class="table table-hover">
            	<c:if test="${(sessionScope.cart.itemCounts+0)==0 }">
            		<tr>
            			<td>您还没有<a href="home.do">购买</a>任何商品！</td>
            		</tr>
            	</c:if>
            
            	<c:if test="${(sessionScope.cart.itemCounts+0)>0}">
			            	<tr>
			                	<td colspan="2">商品</td>
			                    <td>单价</td>
			                    <td>数量</td>
			                    <td>小计</td>
			                </tr>
                	<!-- 获取所有的项，这里的值是允许重复的,重复的值不能算作一个 -->
                	<c:forEach var="goods" items="${sessionScope.cart.allItem}">
			               	<tr>
			                	<td><img src="assets/app/bookpic/${goods.pic }" width="60px" height="60px"> </td>
			                    <td>
			                        <a href="#">书名:${goods.name}</a><br />
			                     			            作者:${goods.author}
			                    </td>
			                    <td>￥<fmt:formatNumber value="${goods.price }" pattern="0.00"/></td>
			                    <td>
			                    	<i class="icon-plus"></i>&nbsp;
			                    	<!-- 加入购物车的时候，默认数量为1，因为在进行购物单查时，并没有把count  set进单查后的结果中，
			                    			所以这里设置为1，便于第一次购物时显示为1 
			                    	value="${goods.count}这里的值不是单查的结果值，而是自己在book.java类里自己定义的属性count的默认值为1
			                    			-->
			                    	<input class="input-mini" type="text" value="${goods.count}">&nbsp;
			                    	<i class="icon-minus"></i>  
			                    </td>
			                    <!-- //这里的数量指的是某类货物的数量，而非各种全部获物的总数量 -->
			                    <td>￥<fmt:formatNumber value="${(goods.price)*(goods.count)}" pattern="0.00"/></td>
			                </tr>
                	</c:forEach>
               </c:if>
            </table>
            <div class="well total_price">
            	<p class="pull-right">总计:<span class="rmb">￥${sessionScope.cart.totalPrice+0}</span></p>
            </div>
            <div class="pull-right check">
            	<a href="home.do" class="btn btn-large">继续购物</a> &nbsp;&nbsp; <a class="btn btn-primary btn-large">去结账</a>
            </div>
</div>
<%@ include file="index_footer.jsp" %>
<script language="javascript" src="style/bootstrap/js/jquery-1.9.1.js"></script> 
<script language="javascript" src="style/bootstrap/js/bootstrap.js"></script>
</body>
</html>
